#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/6/27
# @Author  : LiJun
# @Email   : lijun@tianyancha.com
# @Version : 1.0.0

# 运行时不生成__pycache__


from selenium_0627.po_page.contact_page import ContactPage
from selenium_0627.po_page.base_page import BasePage
import allure

class MainPage(BasePage):

    # 跳转至 通讯录
    def goto_contact(self):
        with allure.step("获取「通讯录」class属性"):
            ele = self.find(*self.by_maps(self.element["CONTACT"]))
        with allure.step("「通讯录」不为选中状态，则点击"):
            if "frame_nav_item_Curr" not in ele.get_attribute("class"):
                ele.click()

        return ContactPage(self.driver, self.element)


